unit frm_ToDoRapidNotes;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, ActnList, StdCtrls, ExtCtrls, FIBDatabase, pFIBDatabase, DB,
  FIBDataSet, pFIBDataSet, DBCtrls;

type
  TfrmToDoRapidNotes = class(TForm)
    Panel1: TPanel;
    Button1: TButton;
    Button2: TButton;
    DBMemo1: TDBMemo;
    dsRapidTodoNotes: TpFIBDataSet;
    trRapidTodoNotes: TpFIBTransaction;
    dscRapidTodoNotes: TDataSource;
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  frmToDoRapidNotes: TfrmToDoRapidNotes;

function ShowRapidNotes(Owner:TComponent; ITodo_id:integer):boolean;

implementation

uses MAIN_DM;

{$R *.dfm}

function ShowRapidNotes(Owner:TComponent; ITodo_id:integer):boolean;
begin
  result := false;
  with TfrmToDoRapidNotes.Create(Owner) do
  begin
    dsRapidTodoNotes.ParamByName('todo_id').Value := ITodo_id;
    dsRapidTodoNotes.Open;
    if dsRapidTodoNotes.RecordCount > 0 then
    begin
      dsRapidTodoNotes.Edit;
      ShowModal;
      if ModalResult = mrOk then
      begin
        dsRapidTodoNotes.Post;
        trRapidTodoNotes.Commit;
        Result := true;
      end;
    end;
    frmToDoRapidNotes.free;
  end;
end;

end.
